package com.ndp.fb.model;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Created by Sisi on 15-3-4.
 */
@Setter
@Getter
@NoArgsConstructor
public class AdResourceStats extends AdStats implements Serializable {
    private static final long serialVersionUID = 6781429265884072756L;
    /**
     * 日期
     */
    private String day;
    /**
     * 用来分片用的id
     */
    private String mongodbId;

    /**
     * 处理开始时间
     */
    private Long processStartTime;
    /**
     * 处理结束时间
     */
    private Long processEndTime;

    private String md5;

    private String resourceType;

    private String imageBathId;
    
    private Long fbConnectionObjectId;

    /**
     * 图片比例 1:1 16:9 4:3 等等
     */
    private String scale;

    /**
     * 以下是业务字段
     */
    private String name;
    private String nfsId;
    private String visitPath;
    private Date createTime;
    private String litNfsId;
    private String litImgURL;
    private Set<String> userIdSet;
    private Integer uploadStatus;
    private Integer isDelete;
    private Long orgId;
    private Map<String, List<Object>> tags;
    private Integer width;
    private Integer height;
    private Integer reviewStatus;                //0 未审核 1已审核   add by evan 2015-09-17
    private String reviewer;                     //审核者
    private Date reviewTime;
    private String adReviewFeedback;             //facebook审核反馈
    private Integer machineCnt;                  //该图片机器审核次数
    private String comments;                     //评语

    /**
     * 需要进行计算的一些字段
     */
    private Double ctr;
    private Double cr;

    private Integer dayRange;

    // 资源来源  1: 内部美宣  2: 外部美宣
    private Integer from;

    private Integer adCount;

    //总查看次数
    private Long totoalPageViews;

    //被查看次数
    private Long numOfPageViews;

    //被查看人数
    private Long peopleNumOfPageViews;

    //ImageHash
    private String imageHash;

    //广告类型
    private String objective;

    // 细分数据
    private String breakdowns;
    private String country;
    private String age;
    private String gender;
    
    private String[] pHash;


    public void initStatsData() {
        this.setClicks(0);
        this.setImpressions(0);
        this.setResults(0);
        this.setSocialClicks(0);
        this.setSocialImpressions(0);
        this.setSocialSpent(0);
        this.setSocialUniqueClicks(0);
        this.setSocialUniqueImpressions(0);
        this.setSpent(0);
        this.setUniqueClicks(0);
        this.setUniqueImpressions(0);
        this.setCost(0.0);
        this.setTotoalPageViews(0l);
        this.setNumOfPageViews(0l);
        this.setProcessStartTime(System.currentTimeMillis());
    }

}
